package cn.no7player.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.no7player.model.AccessToken;
import cn.no7player.service.AccessTokenService;

@Controller
public class AccessTokenController {
	@Autowired
	private AccessTokenService accessTokenService;
	
	
	@RequestMapping("/queryAccessToken")
	public String queryAccessToken(Model model){
		AccessToken accessToken= new AccessToken();
		accessToken.setAppid("wx60db632162e607ba");
		accessToken.setAppsecret("1d8368a3ad05a1b07b33656a5ffbc598");
		String token = accessTokenService.queryAccessToken(accessToken);
		model.addAttribute("token", token);
		return "accessToken";
	}
	

}
